diff --git a/system/libraries/Security.php b/system/libraries/Security.php
index 58db4e7..ceef977 100644
--- a/system/libraries/Security.php
+++ b/system/libraries/Security.php
@@ -22,44 +22,44 @@
  * @subpackage	Libraries
  * @category	Security
  * @author		ExpressionEngine Dev Team
- * @link		http://codeigniter.com/user_guide/libraries/sessions.html
+ * @link		http://codeigniter.com/user_guide/libraries/security.html
  */
 class CI_Security {
-
-	public $xss_hash			= '';
-	public $csrf_hash			= '';
-	public $csrf_expire			= 7200;  // Two hours (in seconds)
-	public $csrf_token_name		= 'ci_csrf_token';
-	public $csrf_cookie_name	= 'ci_csrf_token';
+	
+	protected $_xss_hash			= '';
+	protected $_csrf_hash			= '';
+	protected $_csrf_expire			= 7200;  // Two hours (in seconds)
+	protected $_csrf_token_name		= 'ci_csrf_token';
+	protected $_csrf_cookie_name	= 'ci_csrf_token';
 
 	/* never allowed, string replacement */
-	public $never_allowed_str = array(
-									'document.cookie'	=> '[removed]',
-									'document.write'	=> '[removed]',
-									'.parentNode'		=> '[removed]',
-									'.innerHTML'		=> '[removed]',
-									'window.location'	=> '[removed]',
-									'-moz-binding'		=> '[removed]',
-									'<!--'				=> '&lt;!--',
-									'-->'				=> '--&gt;',
-									'<![CDATA['			=> '&lt;![CDATA['
-									);
-	/* never allowed, regex replacement */
-	public $never_allowed_regex = array(
-										"javascript\s*:"			=> '[removed]',
-										"expression\s*(\(|&\#40;)"	=> '[removed]', // CSS and IE
-										"vbscript\s*:"				=> '[removed]', // IE, surprise!
-										"Redirect\s+302"			=> '[removed]'
-									);
+	protected $_never_allowed_str = array(
+					'document.cookie'	=> '[removed]',
+					'document.write'	=> '[removed]',
+					'.parentNode'		=> '[removed]',
+					'.innerHTML'		=> '[removed]',
+					'window.location'	=> '[removed]',
+					'-moz-binding'		=> '[removed]',
+					'<!--'				=> '&lt;!--',
+					'-->'				=> '--&gt;',
+					'<![CDATA['			=> '&lt;![CDATA['
+	);
 
+	/* never allowed, regex replacement */
+	protected $_never_allowed_regex = array(
+					"javascript\s*:"			=> '[removed]',
+					"expression\s*(\(|&\#40;)"	=> '[removed]', // CSS and IE
+					"vbscript\s*:"				=> '[removed]', // IE, surprise!
+					"Redirect\s+302"			=> '[removed]'
+	);
+	
+	/**
+	 * Constructor
+	 */
 	public function __construct()
 	{
-		$this->csrf_token_name = (config_item('csrf_token_name')) ? config_item('csrf_token_name') : 'csrf_token_name';
-		$this->csrf_cookie_name = (config_item('csrf_cookie_name')) ? config_item('csrf_cookie_name') : 'csrf_cookie_name';
-		$this->csrf_expire = (config_item('csrf_expire')) ? config_item('csrf_expire') : 7200;
-
 		// Append application specific cookie prefix to token name
-		$this->csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->csrf_token_name : $this->csrf_token_name;
+		$this->_csrf_cookie_name = (config_item('cookie_prefix')) ? config_item('cookie_prefix').$this->_csrf_token_name : $this->_csrf_token_name;
 
 		// Set the CSRF hash
 		$this->_csrf_set_hash();
@@ -72,8 +72,7 @@
 	/**
 	 * Verify Cross Site Request Forgery Protection
 	 *
-	 * @access	public
-	 * @return	null
+	 * @return	object
 	 */
 	public function csrf_verify()
 	{
@@ -84,26 +83,30 @@
 		}
 
 		// Do the tokens exist in both the _POST and _COOKIE arrays?
-		if ( ! isset($_POST[$this->csrf_token_name]) OR ! isset($_COOKIE[$this->csrf_cookie_name]))
+		if ( ! isset($_POST[$this->_csrf_token_name]) OR 
+			 ! isset($_COOKIE[$this->_csrf_cookie_name]))
 		{
 			$this->csrf_show_error();
 		}
 
 		// Do the tokens match?
-		if ($_POST[$this->csrf_token_name] != $_COOKIE[$this->csrf_cookie_name])
+		if ($_POST[$this->_csrf_token_name] != $_COOKIE[$this->_csrf_cookie_name])
 		{
 			$this->csrf_show_error();
 		}
 
-		// We kill this since we're done and we don't want to polute the _POST array
-		unset($_POST[$this->csrf_token_name]);
+		// We kill this since we're done and we don't want to 
+		// polute the _POST array
+		unset($_POST[$this->_csrf_token_name]);
 
 		// Nothing should last forever
-		unset($_COOKIE[$this->csrf_cookie_name]);
+		unset($_COOKIE[$this->_csrf_cookie_name]);
 		$this->_csrf_set_hash();
 		$this->csrf_set_cookie();
 
 		log_message('debug', "CSRF token verified ");
+		
+		return $this;
 	}
 
 	// --------------------------------------------------------------------
@@ -111,44 +114,28 @@
 	/**
 	 * Set Cross Site Request Forgery Protection Cookie
 	 *
-	 * @access	public
-	 * @return	null
+	 * @return	object
 	 */
 	public function csrf_set_cookie()
 	{
-		$expire = time() + $this->csrf_expire;
+		$expire = time() + $this->_csrf_expire;
 		$secure_cookie = (config_item('cookie_secure') === TRUE) ? 1 : 0;
 
-		setcookie($this->csrf_cookie_name, $this->csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), $secure_cookie);
-
-		log_message('debug', "CRSF cookie Set");
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * Set Cross Site Request Forgery Protection Cookie
-	 *
-	 * @access	private
-	 * @return	null
-	 */
-	private function _csrf_set_hash()
-	{
-		if ($this->csrf_hash == '')
+		if ($secure_cookie)
 		{
-			// If the cookie exists we will use it's value.  We don't necessarily want to regenerate it with
-			// each page load since a page could contain embedded sub-pages causing this feature to fail
-			if (isset($_COOKIE[$this->csrf_cookie_name]) AND $_COOKIE[$this->csrf_cookie_name] != '')
+			$req = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : FALSE;
+
+			if ( ! $req OR $req == 'off')
 			{
-				$this->csrf_hash = $_COOKIE[$this->csrf_cookie_name];
-			}
-			else
-			{
-				$this->csrf_hash = md5(uniqid(rand(), TRUE));
+				return FALSE;
 			}
 		}
 
-		return $this->csrf_hash;
+		setcookie($this->_csrf_cookie_name, $this->_csrf_hash, $expire, config_item('cookie_path'), config_item('cookie_domain'), $secure_cookie);
+
+		log_message('debug', "CRSF cookie Set");
+		
+		return $this;
 	}
 
 	// --------------------------------------------------------------------
@@ -156,8 +143,7 @@
 	/**
 	 * Show CSRF Error
 	 *
-	 * @access	public
-	 * @return	null
+	 * @return	void
 	 */
 	public function csrf_show_error()
 	{
@@ -167,6 +153,34 @@
 	// --------------------------------------------------------------------
 
 	/**
+	 * Get CSRF Hash 
+	 *
+	 * Getter Method 
+	 *
+	 * @return 	string 	self::_csrf_hash
+	 */
+	public function get_csrf_hash()
+	{
+		return $this->_csrf_hash;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Get CSRF Token Name
+	 *
+	 * Getter Method
+	 *
+	 * @return 	string 	self::csrf_token_name
+	 */
+	public function get_csrf_token_name()
+	{
+		return $this->_csrf_token_name;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
 	 * XSS Clean
 	 *
 	 * Sanitizes data so that Cross Site Scripting Hacks can be
@@ -188,7 +202,6 @@
 	 * harvested from examining vulnerabilities in other programs:
 	 * http://ha.ckers.org/xss.html
 	 *
-	 * @access	public
 	 * @param	mixed	string or array
 	 * @return	string
 	 */
@@ -213,35 +226,8 @@
 		 */
 		$str = remove_invisible_characters($str);
 
-		/*
-		 * Protect GET variables in URLs
-		 */
-
-		 // 901119URL5918AMP18930PROTECT8198
-
-		$str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str);
-
-		/*
-		 * Validate standard character entities
-		 *
-		 * Add a semicolon if missing.  We do this to enable
-		 * the conversion of entities to ASCII later.
-		 *
-		 */
-		$str = preg_replace('#(&\#?[0-9a-z]{2,})([\x00-\x20])*;?#i', "\\1;\\2", $str);
-
-		/*
-		 * Validate UTF16 two byte encoding (x00)
-		 *
-		 * Just as above, adds a semicolon if missing.
-		 *
-		 */
-		$str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str);
-
-		/*
-		 * Un-Protect GET variables in URLs
-		 */
-		$str = str_replace($this->xss_hash(), '&', $str);
+		// Validate Entities in URLs
+		$str = $this->_validate_entities($str);
 
 		/*
 		 * URL Decode
@@ -265,7 +251,7 @@
 		 */
 
 		$str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", array($this, '_convert_attribute'), $str);
-
+	
 		$str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", array($this, '_decode_entity'), $str);
 
 		/*
@@ -278,9 +264,8 @@
 		 *
 		 * This prevents strings like this: ja	vascript
 		 * NOTE: we deal with spaces between characters later.
-		 * NOTE: preg_replace was found to be amazingly slow here on large blocks of data,
-		 * so we use str_replace.
-		 *
+		 * NOTE: preg_replace was found to be amazingly slow here on 
+		 * large blocks of data, so we use str_replace.
 		 */
 
 		if (strpos($str, "\t") !== FALSE)
@@ -293,34 +278,23 @@
 		 */
 		$converted_string = $str;
 
-		/*
-		 * Not Allowed Under Any Conditions
-		 */
-
-		foreach ($this->never_allowed_str as $key => $val)
-		{
-			$str = str_replace($key, $val, $str);
-		}
-
-		foreach ($this->never_allowed_regex as $key => $val)
-		{
-			$str = preg_replace("#".$key."#i", $val, $str);
-		}
+		// Remove Strings that are never allowed
+		$str = $this->_do_never_allowed($str);
 
 		/*
 		 * Makes PHP tags safe
 		 *
-		 *  Note: XML tags are inadvertently replaced too:
+		 * Note: XML tags are inadvertently replaced too:
 		 *
-		 *	<?xml
+		 * <?xml
 		 *
 		 * But it doesn't seem to pose a problem.
-		 *
 		 */
 		if ($is_image === TRUE)
 		{
-			// Images have a tendency to have the PHP short opening and closing tags every so often
-			// so we skip those and only do the long opening tags.
+			// Images have a tendency to have the PHP short opening and 
+			// closing tags every so often so we skip those and only 
+			// do the long opening tags.
 			$str = preg_replace('/<\?(php)/i', "&lt;?\\1", $str);
 		}
 		else
@@ -333,9 +307,12 @@
 		 *
 		 * This corrects words like:  j a v a s c r i p t
 		 * These words are compacted back to their correct state.
-		 *
 		 */
-		$words = array('javascript', 'expression', 'vbscript', 'script', 'applet', 'alert', 'document', 'write', 'cookie', 'window');
+		$words = array(
+				'javascript', 'expression', 'vbscript', 'script', 
+				'applet', 'alert', 'document', 'write', 'cookie', 'window'
+			);
+			
 		foreach ($words as $word)
 		{
 			$temp = '';
@@ -352,8 +329,9 @@
 
 		/*
 		 * Remove disallowed Javascript in links or img tags
-		 * We used to do some version comparisons and use of stripos for PHP5, but it is dog slow compared
-		 * to these simplified non-capturing preg_match(), especially if the pattern exists in the string
+		 * We used to do some version comparisons and use of stripos for PHP5, 
+		 * but it is dog slow compared to these simplified non-capturing 
+		 * preg_match(), especially if the pattern exists in the string
 		 */
 		do
 		{
@@ -374,30 +352,12 @@
 				$str = preg_replace("#<(/*)(script|xss)(.*?)\>#si", '[removed]', $str);
 			}
 		}
-		while ($original != $str);
+		while($original != $str);
 
 		unset($original);
 
-		/*
-		 * Remove JavaScript Event Handlers
-		 *
-		 * Note: This code is a little blunt.  It removes
-		 * the event handler and anything up to the closing >,
-		 * but it's unlikely to be a problem.
-		 *
-		 */
-		$event_handlers = array('[^a-z_\-]on\w*','xmlns');
-
-		if ($is_image === TRUE)
-		{
-			/*
-			 * Adobe Photoshop puts XML metadata into JFIF images, including namespacing,
-			 * so we have to allow this for images. -Paul
-			 */
-			unset($event_handlers[array_search('xmlns', $event_handlers)]);
-		}
-
-		$str = preg_replace("#<([^><]+?)(".implode('|', $event_handlers).")(\s*=\s*[^><]*)([><]*)#i", "<\\1\\4", $str);
+		// Remove evil attributes such as style, onclick and xmlns
+		$str = $this->_remove_evil_attributes($str, $is_image);
 
 		/*
 		 * Sanitize naughty HTML elements
@@ -407,7 +367,6 @@
 		 *
 		 * So this: <blink>
 		 * Becomes: &lt;blink&gt;
-		 *
 		 */
 		$naughty = 'alert|applet|audio|basefont|base|behavior|bgsound|blink|body|embed|expression|form|frameset|frame|head|html|ilayer|iframe|input|isindex|layer|link|meta|object|plaintext|style|script|textarea|title|video|xml|xss';
 		$str = preg_replace_callback('#<(/*\s*)('.$naughty.')([^><]*)([><]*)#is', array($this, '_sanitize_naughty_html'), $str);
@@ -423,45 +382,28 @@
 		 *
 		 * For example:	eval('some code')
 		 * Becomes:		eval&#40;'some code'&#41;
-		 *
 		 */
 		$str = preg_replace('#(alert|cmd|passthru|eval|exec|expression|system|fopen|fsockopen|file|file_get_contents|readfile|unlink)(\s*)\((.*?)\)#si', "\\1\\2&#40;\\3&#41;", $str);
 
-		/*
-		 * Final clean up
-		 *
-		 * This adds a bit of extra precaution in case
-		 * something got through the above filters
-		 *
-		 */
-		foreach ($this->never_allowed_str as $key => $val)
-		{
-			$str = str_replace($key, $val, $str);
-		}
 
-		foreach ($this->never_allowed_regex as $key => $val)
-		{
-			$str = preg_replace("#".$key."#i", $val, $str);
-		}
+		// Final clean up
+		// This adds a bit of extra precaution in case
+		// something got through the above filters
+		$str = $this->_do_never_allowed($str);
 
 		/*
-		 *  Images are Handled in a Special Way
-		 *  - Essentially, we want to know that after all of the character conversion is done whether
-		 *  any unwanted, likely XSS, code was found.  If not, we return TRUE, as the image is clean.
-		 *  However, if the string post-conversion does not matched the string post-removal of XSS,
-		 *  then it fails, as there was unwanted XSS code found and removed/changed during processing.
+		 * Images are Handled in a Special Way
+		 * - Essentially, we want to know that after all of the character 
+		 * conversion is done whether any unwanted, likely XSS, code was found.  
+		 * If not, we return TRUE, as the image is clean.
+		 * However, if the string post-conversion does not matched the 
+		 * string post-removal of XSS, then it fails, as there was unwanted XSS 
+		 * code found and removed/changed during processing.
 		 */
 
 		if ($is_image === TRUE)
 		{
-			if ($str == $converted_string)
-			{
-				return TRUE;
-			}
-			else
-			{
-				return FALSE;
-			}
+			return ($str == $converted_string) ? TRUE: FALSE;
 		}
 
 		log_message('debug', "XSS Filtering completed");
@@ -473,157 +415,25 @@
 	/**
 	 * Random Hash for protecting URLs
 	 *
-	 * @access	public
 	 * @return	string
 	 */
 	public function xss_hash()
 	{
-		if ($this->xss_hash == '')
+		if ($this->_xss_hash == '')
 		{
 			if (phpversion() >= 4.2)
-				mt_srand();
-			else
-				mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);
-
-			$this->xss_hash = md5(time() + mt_rand(0, 1999999999));
-		}
-
-		return $this->xss_hash;
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * Compact Exploded Words
-	 *
-	 * Callback function for xss_clean() to remove whitespace from
-	 * things like j a v a s c r i p t
-	 *
-	 * @access	private
-	 * @param	type
-	 * @return	type
-	 */
-	private function _compact_exploded_words($matches)
-	{
-		return preg_replace('/\s+/s', '', $matches[1]).$matches[2];
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * Sanitize Naughty HTML
-	 *
-	 * Callback function for xss_clean() to remove naughty HTML elements
-	 *
-	 * @access	private
-	 * @param	array
-	 * @return	string
-	 */
-	private function _sanitize_naughty_html($matches)
-	{
-		// encode opening brace
-		$str = '&lt;'.$matches[1].$matches[2].$matches[3];
-
-		// encode captured opening or closing brace to prevent recursive vectors
-		$str .= str_replace(array('>', '<'), array('&gt;', '&lt;'), $matches[4]);
-
-		return $str;
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * JS Link Removal
-	 *
-	 * Callback function for xss_clean() to sanitize links
-	 * This limits the PCRE backtracks, making it more performance friendly
-	 * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in
-	 * PHP 5.2+ on link-heavy strings
-	 *
-	 * @access	private
-	 * @param	array
-	 * @return	string
-	 */
-	private function _js_link_removal($match)
-	{
-		$attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]));
-		return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si", "", $attributes), $match[0]);
-	}
-
-	/**
-	 * JS Image Removal
-	 *
-	 * Callback function for xss_clean() to sanitize image tags
-	 * This limits the PCRE backtracks, making it more performance friendly
-	 * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in
-	 * PHP 5.2+ on image tag heavy strings
-	 *
-	 * @access	private
-	 * @param	array
-	 * @return	string
-	 */
-	private function _js_img_removal($match)
-	{
-		$attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]));
-		return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si", "", $attributes), $match[0]);
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * Attribute Conversion
-	 *
-	 * Used as a callback for XSS Clean
-	 *
-	 * @access	private
-	 * @param	array
-	 * @return	string
-	 */
-	private function _convert_attribute($match)
-	{
-		return str_replace(array('>', '<', '\\'), array('&gt;', '&lt;', '\\\\'), $match[0]);
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * Filter Attributes
-	 *
-	 * Filters tag attributes for consistency and safety
-	 *
-	 * @access	private
-	 * @param	string
-	 * @return	string
-	 */
-	private function _filter_attributes($str)
-	{
-		$out = '';
-
-		if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches))
-		{
-			foreach ($matches[0] as $match)
 			{
-				$out .= preg_replace("#/\*.*?\*/#s", '', $match);
+				mt_srand();
 			}
+			else
+			{
+				mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);
+			}
+
+			$this->_xss_hash = md5(time() + mt_rand(0, 1999999999));
 		}
 
-		return $out;
-	}
-
-	// --------------------------------------------------------------------
-
-	/**
-	 * HTML Entity Decode Callback
-	 *
-	 * Used as a callback for XSS Clean
-	 *
-	 * @access	private
-	 * @param	array
-	 * @return	string
-	 */
-	private function _decode_entity($match)
-	{
-		return $this->entity_decode($match[0], strtoupper(config_item('charset')));
+		return $this->_xss_hash;
 	}
 
 	// --------------------------------------------------------------------
@@ -642,7 +452,6 @@
 	 * character set, and the PHP developers said they were not back porting the
 	 * fix to versions other than PHP 5.x.
 	 *
-	 * @access	public
 	 * @param	string
 	 * @param	string
 	 * @return	string
@@ -657,7 +466,8 @@
 		// correctly.  html_entity_decode() does not convert entities without
 		// semicolons, so we are left with our own little solution here. Bummer.
 
-		if (function_exists('html_entity_decode') && (strtolower($charset) != 'utf-8' OR is_php('5.0.0')))
+		if (function_exists('html_entity_decode') && 
+			(strtolower($charset) != 'utf-8'))
 		{
 			$str = html_entity_decode($str, ENT_COMPAT, $charset);
 			$str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str);
@@ -682,7 +492,6 @@
 	/**
 	 * Filename Security
 	 *
-	 * @access	public
 	 * @param	string
 	 * @return	string
 	 */
@@ -721,16 +530,289 @@
 						"%3b",		// ;
 						"%3d"		// =
 					);
-
+		
 		if ( ! $relative_path)
 		{
 			$bad[] = './';
 			$bad[] = '/';
 		}
 
+		$str = remove_invisible_characters($str, FALSE);
 		return stripslashes(str_replace($bad, '', $str));
 	}
 
+	// ----------------------------------------------------------------
+
+	/**
+	 * Compact Exploded Words
+	 *
+	 * Callback function for xss_clean() to remove whitespace from
+	 * things like j a v a s c r i p t
+	 *
+	 * @param	type
+	 * @return	type
+	 */
+	protected function _compact_exploded_words($matches)
+	{
+		return preg_replace('/\s+/s', '', $matches[1]).$matches[2];
+	}
+
+	// --------------------------------------------------------------------
+	
+	/*
+	 * Remove Evil HTML Attributes (like evenhandlers and style)
+	 *
+	 * It removes the evil attribute and either:
+	 * 	- Everything up until a space
+	 *		For example, everything between the pipes:
+	 *		<a |style=document.write('hello');alert('world');| class=link>
+	 * 	- Everything inside the quotes 
+	 *		For example, everything between the pipes:
+	 *		<a |style="document.write('hello'); alert('world');"| class="link">
+	 *
+	 * @param string $str The string to check
+	 * @param boolean $is_image TRUE if this is an image
+	 * @return string The string with the evil attributes removed
+	 */
+	protected function _remove_evil_attributes($str, $is_image)
+	{
+		// All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns
+		$evil_attributes = array('on\w*', 'style', 'xmlns');
+
+		if ($is_image === TRUE)
+		{
+			/*
+			 * Adobe Photoshop puts XML metadata into JFIF images, 
+			 * including namespacing, so we have to allow this for images.
+			 */
+			unset($evil_attributes[array_search('xmlns', $evil_attributes)]);
+		}
+		
+		do {
+			$str = preg_replace(
+				"#<(/?[^><]+?)([^A-Za-z\-])(".implode('|', $evil_attributes).")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i",
+				"<$1$6",
+				$str, -1, $count
+			);
+		} while ($count);
+		
+		return $str;
+	}
+	
+	// --------------------------------------------------------------------
+
+	/**
+	 * Sanitize Naughty HTML
+	 *
+	 * Callback function for xss_clean() to remove naughty HTML elements
+	 *
+	 * @param	array
+	 * @return	string
+	 */
+	protected function _sanitize_naughty_html($matches)
+	{
+		// encode opening brace
+		$str = '&lt;'.$matches[1].$matches[2].$matches[3];
+
+		// encode captured opening or closing brace to prevent recursive vectors
+		$str .= str_replace(array('>', '<'), array('&gt;', '&lt;'), 
+							$matches[4]);
+
+		return $str;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * JS Link Removal
+	 *
+	 * Callback function for xss_clean() to sanitize links
+	 * This limits the PCRE backtracks, making it more performance friendly
+	 * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in
+	 * PHP 5.2+ on link-heavy strings
+	 *
+	 * @param	array
+	 * @return	string
+	 */
+	protected function _js_link_removal($match)
+	{
+		$attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]));
+		
+		return str_replace($match[1], preg_replace("#href=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si", "", $attributes), $match[0]);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * JS Image Removal
+	 *
+	 * Callback function for xss_clean() to sanitize image tags
+	 * This limits the PCRE backtracks, making it more performance friendly
+	 * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in
+	 * PHP 5.2+ on image tag heavy strings
+	 *
+	 * @param	array
+	 * @return	string
+	 */
+	protected function _js_img_removal($match)
+	{
+		$attributes = $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]));
+		
+		return str_replace($match[1], preg_replace("#src=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si", "", $attributes), $match[0]);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Attribute Conversion
+	 *
+	 * Used as a callback for XSS Clean
+	 *
+	 * @param	array
+	 * @return	string
+	 */
+	protected function _convert_attribute($match)
+	{
+		return str_replace(array('>', '<', '\\'), array('&gt;', '&lt;', '\\\\'), $match[0]);
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Filter Attributes
+	 *
+	 * Filters tag attributes for consistency and safety
+	 *
+	 * @param	string
+	 * @return	string
+	 */
+	protected function _filter_attributes($str)
+	{
+		$out = '';
+
+		if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches))
+		{
+			foreach ($matches[0] as $match)
+			{
+				$out .= preg_replace("#/\*.*?\*/#s", '', $match);
+			}
+		}
+
+		return $out;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * HTML Entity Decode Callback
+	 *
+	 * Used as a callback for XSS Clean
+	 *
+	 * @param	array
+	 * @return	string
+	 */
+	protected function _decode_entity($match)
+	{
+		return $this->entity_decode($match[0], strtoupper(config_item('charset')));
+	}
+
+	// --------------------------------------------------------------------
+	
+	/**
+	 * Validate URL entities
+	 *
+	 * Called by xss_clean()
+	 *
+	 * @param 	string	
+	 * @return 	string
+	 */
+	protected function _validate_entities($str)
+	{
+		/*
+		 * Protect GET variables in URLs
+		 */
+		
+		 // 901119URL5918AMP18930PROTECT8198
+		
+		$str = preg_replace('|\&([a-z\_0-9\-]+)\=([a-z\_0-9\-]+)|i', $this->xss_hash()."\\1=\\2", $str);
+
+		/*
+		 * Validate standard character entities
+		 *
+		 * Add a semicolon if missing.  We do this to enable
+		 * the conversion of entities to ASCII later.
+		 *
+		 */
+		$str = preg_replace('#(&\#?[0-9a-z]{2,})([\x00-\x20])*;?#i', "\\1;\\2", $str);
+
+		/*
+		 * Validate UTF16 two byte encoding (x00)
+		 *
+		 * Just as above, adds a semicolon if missing.
+		 *
+		 */
+		$str = preg_replace('#(&\#x?)([0-9A-F]+);?#i',"\\1\\2;",$str);
+
+		/*
+		 * Un-Protect GET variables in URLs
+		 */
+		$str = str_replace($this->xss_hash(), '&', $str);
+		
+		return $str;
+	}
+
+	// ----------------------------------------------------------------------
+
+	/**
+	 * Do Never Allowed
+	 *
+	 * A utility function for xss_clean()
+	 *
+	 * @param 	string
+	 * @return 	string
+	 */
+	protected function _do_never_allowed($str)
+	{
+		foreach ($this->_never_allowed_str as $key => $val)
+		{
+			$str = str_replace($key, $val, $str);
+		}
+
+		foreach ($this->_never_allowed_regex as $key => $val)
+		{
+			$str = preg_replace("#".$key."#i", $val, $str);
+		}
+		
+		return $str;
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Set Cross Site Request Forgery Protection Cookie
+	 *
+	 * @return	string
+	 */
+	protected function _csrf_set_hash()
+	{
+		if ($this->_csrf_hash == '')
+		{
+			// If the cookie exists we will use it's value.  
+			// We don't necessarily want to regenerate it with
+			// each page load since a page could contain embedded 
+			// sub-pages causing this feature to fail
+			if (isset($_COOKIE[$this->_csrf_cookie_name]) && 
+				$_COOKIE[$this->_csrf_cookie_name] != '')
+			{
+				return $this->_csrf_hash = $_COOKIE[$this->_csrf_cookie_name];
+			}
+			
+			return $this->_csrf_hash = md5(uniqid(rand(), TRUE));
+		}
+
+		return $this->_csrf_hash;
+	}
+
 }
 // END Security Class
 
